#pragma once
#include <QtWidgets>
#include <qdebug.h>
#include <QtWidgets/QMainWindow>
#include "ui_project.h"
#include "ILogic.h"

class QPushButton;
class QRadioButton;
class QLayout;
class QComboBox;
 class QTreeWidgetItem;
 class QTreeWidget;


class GUI : public QMainWindow,public Ui::GUIClass
{
	Q_OBJECT
public:
	GUI(QWidget *parent = 0);
	~GUI();

protected:
    bool eventFilter(QObject *obj, QEvent *ev);

public slots:
	void slotConnect();				
	void slotShowDirectory();
	void slotTakeScreenshot();
	void slotCreate();
	void slotDelete();
	void slotCopy();
	void slotCut();
	void slotPaste();
	void slotRename();
	void slotSellectAll();
	void slotInstall();
	void slotGetBackup();
	void slotRestore();
	void slotOptions();
	void slotAbout();
	void slotHelp();
	void slotChangeCurrentDevice(int);	
	void treeViewUpdate(QTreeWidgetItem*,int);
	void UpdateDeviceList();
	void InputDirectories(QString,QTreeWidgetItem*);
	void InputDataToTable(QList<FileSystem>);
	void tableUpdate(int,int);
	void GoToUpperDirectory();
	void slotRBChecked();
	void slotGoBackup();
	void slotPush();
	void slotPull();

private:
	ILogic* _logic; //instance of Logic
	void setConections();	//there are all connection on GUI class
	void setupActions();
	void ShowHelp();	//method will show Help window
	void ShowAbout();	//method will show Help window
	void Initialization();	//initialiation in c-tor
	QWidget* _helpWindow;
	QWidget* _aboutWindow;
	QWidget* _connectWindow;
	QWidget* _backupWindow;
	QList<Devices> devices;
	void showWifiConnectionWindow();
	bool checkInputIP(QString);
	QTreeWidgetItem *topLevelItem;
	QString fileSystemPath;
	QIcon folderIcon,fileIcon;
	
	bool isDevice();
	void showWarningMB(QString);
	///private members for backup window
		QString pathToBackup;
		QRadioButton* rbApk;
		QRadioButton* rbNoapk;
		QRadioButton* rbShared;
		QRadioButton* rbNoshared;
		QPushButton * pbGO;
		bool apk;
		bool shared;
	////
	void tryToCreateNewFolder();
	void tryToDeleteFolder();
	QWidget* _newFolder;
	QString _pullPath;
	QStringList _pushPath;
	QStringList* _buffToCopy;
	bool _isOnCopy;

};


